package com.dinzeer.pseudoedge_break_dawn.data;

import com.dinzeer.pseudoedge_break_dawn.Pseudoedge_break_dawn;
import com.dinzeer.pseudoedge_break_dawn.register.PbdCreativeTab;
import com.dinzeer.pseudoedge_break_dawn.register.PbdSlashArtRegsitry;
import mods.flammpfeil.slashblade.SlashBlade;
import mods.flammpfeil.slashblade.data.builtin.SlashBladeBuiltInRegistry;
import mods.flammpfeil.slashblade.item.SwordType;
import mods.flammpfeil.slashblade.registry.SlashArtsRegistry;
import mods.flammpfeil.slashblade.registry.slashblade.EnchantmentDefinition;
import mods.flammpfeil.slashblade.registry.slashblade.PropertiesDefinition;
import mods.flammpfeil.slashblade.registry.slashblade.RenderDefinition;
import mods.flammpfeil.slashblade.registry.slashblade.SlashBladeDefinition;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraftforge.registries.ForgeRegistries;

import java.util.List;

public class PbdBuiltInRegsitry {
    //钻石剑「」
    public static final ResourceKey<SlashBladeDefinition> blade_diamond=register("blade_diamond");
    //铁剑「」
    public static final ResourceKey<SlashBladeDefinition> blade_iron=register("blade_iron");
    //石剑「」
    public static final ResourceKey<SlashBladeDefinition>  blade_stone=register("blade_stone");
    //金剑「」
    public static final ResourceKey<SlashBladeDefinition>  blade_gold=register("blade_gold");
    //木剑「」
    public static final ResourceKey<SlashBladeDefinition>  blade_wood=register("blade_wood");
    //下界合金剑「」
    public static final ResourceKey<SlashBladeDefinition> blade_netherite=register("blade_netherite");
    //次元之刃「伪」
    public static final ResourceKey<SlashBladeDefinition> dimension=register("dimension");;
    //龙刃「猩红」
    public static final ResourceKey<SlashBladeDefinition> dragonblade=register("dragonblade");;
    //黑瞳
    public static final ResourceKey<SlashBladeDefinition> blackpixie=register("blackpixie");;
    //「灭」
    public static final ResourceKey<SlashBladeDefinition> kingblade=register("kingblade");;
    //山樱「伪」
    public static final ResourceKey<SlashBladeDefinition> kumasakura=register("kumasakura");;
    //魔刃
    public static final ResourceKey<SlashBladeDefinition> magicblade=register("magicblade");;
    //紫刃「虚」
    public static final ResourceKey<SlashBladeDefinition> purplesblade=register("purplesblade");;
    //「黑刃」
    public static final ResourceKey<SlashBladeDefinition> pseudosword=register("pseudosword");;
    //「白刃」
    public static final ResourceKey<SlashBladeDefinition> whitesword=register("whitesword");;
    //「隐月·刃」
    public static final ResourceKey<SlashBladeDefinition> latent=register("latent");;
    //荆棘之刃「虚」
    public static final ResourceKey<SlashBladeDefinition> vitex=register("vitex");;
    //「命刃」
    public static final ResourceKey<SlashBladeDefinition> xblades=register("xblades");;




    public static void registerAll(BootstapContext<SlashBladeDefinition> bootstrap) {
        bootstrap.register(
                blade_diamond, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("blade_diamond"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade1.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.DRIVE_VERTICAL.getId())
                                .baseAttackModifier(7)
                                .maxDamage(300)
                                .build(),
                        List.of(
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                blade_iron, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("blade_iron"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade2.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.DRIVE_VERTICAL.getId())
                                .baseAttackModifier(6)
                                .maxDamage(300)
                                .build(),
                        List.of(
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                blade_stone, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("blade_stone"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade3.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.DRIVE_VERTICAL.getId())
                                .baseAttackModifier(5)
                                .maxDamage(300)
                                .build(),
                        List.of(
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                blade_gold, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("blade_gold"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade4.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.DRIVE_VERTICAL.getId())
                                .baseAttackModifier(4)
                                .maxDamage(300)
                                .build(),
                        List.of(
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                blade_wood, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("blade_wood"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade6.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.DRIVE_VERTICAL.getId())
                                .baseAttackModifier(4)
                                .maxDamage(300)
                                .build(),
                        List.of(
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                blade_netherite, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("blade_netherite"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade5.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blade/blade.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.DRIVE_VERTICAL.getId())
                                .baseAttackModifier(10)
                                .maxDamage(300)
                                .build(),
                        List.of(
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                dimension, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("dimension"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/dimension/dimension.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/dimension/dimension.obj"))
                                .effectColor(14156031)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(PbdSlashArtRegsitry.ThrustEEX.getId())
                                .baseAttackModifier(29)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 5)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                dragonblade, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("dragonblade"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/dragonblade/dragonblade.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/dragonblade/dragonblade.obj"))
                                .effectColor(16711680)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(PbdSlashArtRegsitry.DragonBoost.getId())
                                .baseAttackModifier(34)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.MOB_LOOTING), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.KNOCKBACK), 5)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                blackpixie, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("blackpixie"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/blackpixie/blackpixie.png"))
                                .modelName(SlashBlade.prefix("model/named/sange/sange.obj"))
                                .effectColor(0)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(PbdSlashArtRegsitry.BlackHole.getId())
                                .baseAttackModifier(35)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.MOB_LOOTING), 3),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.KNOCKBACK), 2)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                kingblade, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("kingblade"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/kingblade/kingblade.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/kingblade/kingblade.obj"))
                                .effectColor(16711680)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(PbdSlashArtRegsitry.kingblade.getId())
                                .baseAttackModifier(23)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 3),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 2)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                kumasakura, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("kumasakura"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/kumasakura/kumasakura.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/kumasakura/kumasakura.obj"))
                                .effectColor(15662848)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.WAVE_EDGE.getId())
                                .baseAttackModifier(19)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 3),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 3)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                magicblade, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("magicblade"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/magicblade/magicblade.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/magicblade/magicblade.obj"))
                                .effectColor(0)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(PbdSlashArtRegsitry.Blackslash.getId())
                                .baseAttackModifier(32)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SMITE), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 3)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));

        bootstrap.register(
                purplesblade, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("purplesblade"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/purplesblade/purplesblade.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/purplesblade/purplesblade.obj"))
                                .effectColor(9765119)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(PbdSlashArtRegsitry.ThrustSlash.getId())
                                .baseAttackModifier(14)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 2)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                pseudosword, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("pseudosword"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/sword/pseudosword.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/sword/sword.obj"))
                                .effectColor(0)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(SlashArtsRegistry.WAVE_EDGE.getId())
                                .baseAttackModifier(30)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SMITE), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 2)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                whitesword, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("whitesword"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/sword/whitensword.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/sword/sword.obj"))
                                .effectColor(16777215)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .baseAttackModifier(28)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.MOB_LOOTING), 1),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 1)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                latent, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("latent"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/latent/latent.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/emptyblade/emptyblade.obj"))
                                .effectColor(0)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .baseAttackModifier(25)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 3)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                vitex, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("vitex"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/vitex/vitex.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/vitex/vitex.obj"))
                                .effectColor(9765119)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(PbdSlashArtRegsitry.ThrustSlashEX.getId())
                                .baseAttackModifier(30)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 2),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.THORNS), 3)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));
        bootstrap.register(
                xblades, new SlashBladeDefinition(Pseudoedge_break_dawn.prefix("xblades"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/xblades/xblades.png"))
                                .modelName(Pseudoedge_break_dawn.prefix("model/pseudo/named/pseudosword/xblades/xblades.obj"))
                                .effectColor(16711680)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .baseAttackModifier(21)
                                .maxDamage(300)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SHARPNESS), 5),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.FIRE_ASPECT), 2)
                        ),
                        PbdCreativeTab.Slashblade.getId()
                ));

    }



    private static ResourceKey<SlashBladeDefinition> register(String id) {
        return ResourceKey.create(SlashBladeDefinition.REGISTRY_KEY, Pseudoedge_break_dawn.prefix(id));
    }
    static ResourceLocation getEnchantmentID(Enchantment enchantment) {
        return ForgeRegistries.ENCHANTMENTS.getKey(enchantment);
    }


}
